<?php
$conn = mysql_connect('localhost', '', '');

if (!$conn)
  {
    die('Connect Error (' . mysql_error(). ')');
  }
mysql_select_db("diycity",$conn);

$file = fopen("wow", 'r');

while (!feof($file)) {
  $line =  fgets($file);
  $addrs_string = trim($line);
  $addrs_string = str_replace("\n", "", $addrs_string);
  $addrs_string = str_replace("\r", "", $addrs_string);

  $query = "INSERT INTO address_suggest_sigugun(`address_string`) VALUES('". $addrs_string . "')";

  $result = mysql_query($query);
  
  if (!$result)
    {
      echo mysql_error();
      break;
    }
 }

?>
